package com.caiyi.financial.nirvana.sms.controller;

import com.caiyi.financial.nirvana.sms.entity.SmsBatchMsg;
import com.caiyi.financial.nirvana.sms.querybean.QueryBatchMsgBean;
import com.caiyi.financial.nirvana.sms.service.SmsBatchMsgService;
import com.youyu.common.api.Result;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "批次记录接口")
@RestController
@CrossOrigin
@RequestMapping("sms/batchMsg")
public class BatchMsgController extends BaseController {


    @Autowired
    private SmsBatchMsgService BatchMsgService;


    @ApiOperation(value = "根据params查找BatchMsg详情", notes = "根据params查找BatchMsg详情描述")
    @ApiResponses({@ApiResponse(code = 0000, message = "成功", response = SmsBatchMsg.class),
                   @ApiResponse(code = 9999, message = "失败", response = String.class)})
    @PostMapping("/getBatchMsgByParams")
    public Result getBatchMsgByParams(@RequestBody @ApiParam(name = "bean", value = "查找批量短信参数", required = true) QueryBatchMsgBean bean) {
        bean.setAccount(smsUser.getAccount());
        return Result.ok(BatchMsgService.getBatchMsgByParams(bean));

    }
}
